home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 03 - 1987 / 03.02 Feb 87 / Basic Benchmarks / String Operations / match < prev   
Encoding:
Text File  |  1986-10-24  |  450 b   |  26 lines  |  [TEXT/MSBB]

  1. PRINT "String Pattern Matching"
  2. PRINT "30,000 Iterations"
  3.  
  4. start = TIMER   ' calculate the overhead
  5. FOR i% = 1 TO 30000
  6. NEXT i%
  7. finish = TIMER
  8. overhead = finish - start
  9.  
  10. a$ = "This is an example string"
  11. b$ = "example"
  12. start = TIMER
  13. FOR i% = 1 TO 30000
  14.     x% = INSTR(a$,b$)
  15. NEXT i%
  16.  
  17. finish = TIMER
  18.  
  19. PRINT "finish = ";finish
  20. PRINT "start  = ";start
  21. PRINT "Overhead = ";overhead
  22.  
  23. PRINT ((finish - start)-overhead); " seconds"
  24. WHILE INKEY$ = "" : WEND
  25.  
  26.